<template>
    <view class="pub_page pub_page_bg pub_ad_detail pub_header_padding">
        <pub-head headerName="demo" :headerConfig="headerConfig"></pub-head>
        <div class="pub_page_scroll page_box" v-if="adInfo != ''">
            <pub-image class="img" v-for="(li,key) in adInfo.detailImg" :src="li" :mode="'widthFix'"></pub-image>
        </div>
    </view>
</template>

<script>
export default {
    data() {
        return {
            pagescrollTop: 0,
            headerConfig: {
                title: '广告详情',//标题栏内容
                left_type: 3,
            },

            adId: '',
            adInfo: '',
        };
    },
    onLoad(options) {
        this.adId = options.adId || '';
        if (this.adId) {
            this.getAdInfo();
        }
    },
    methods: {
        async getAdInfo() {
            let res = await this.$request.get('quan/getAdInfo', {
                adId: this.adId,
            });
            if (res.code == 200) {
                res.result.detailImg = res.result.detailImg ? res.result.detailImg.split(",") : [];
                this.adInfo = res.result;
            }
        }
    },
};
</script>

<style lang="scss" scoped>
@import "@/common/css/square.scss";
</style>
